commonlibsse_ng\re\h/
hkRotation.rs

1use crate::re::hkMatrix3::hkMatrix3;
2
3/// Represents a 3x3 rotation matrix in the Havok system.
4///
5/// Inherits from `hkMatrix3` and enforces 16-byte alignment.
6///
7/// # Memory Layout:
8/// - `__base`: Base class `hkMatrix3` (0x00 - 0x2F)
9#[repr(C, align(16))]
10#[derive(Debug, Clone, Copy)]
11pub struct hkRotation {
12    /// Base class `hkMatrix3` containing the 3x3 matrix data.
13    /// - Offset: 0x00
14    pub __base: hkMatrix3,
15}
16
17// Compile-time memory layout verification
18const _: () = {
19    assert!(core::mem::offset_of!(hkRotation, __base) == 0x0);
20    assert!(core::mem::size_of::<hkRotation>() == 0x30);
21    assert!(core::mem::align_of::<hkRotation>() == 0x10);
22};
23
24impl hkRotation {
25    /// Creates a new `hkRotation` with an identity matrix.
26    #[inline]
27    pub fn new() -> Self {
28        Self {
29            __base: hkMatrix3::new(), // Zero-initialized; could be adjusted to identity if needed
30        }
31    }
32}
33
34impl Default for hkRotation {
35    #[inline]
36    fn default() -> Self {
37        Self::new()
38    }
39}